home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
BBS
/
MUBBS
/
bbslst11.cpt
/
BBSList.c
< prev
next >
Wrap
Text File
|
1991-12-31
|
4KB
|
140 lines
/*
* BBS List Module - Version 1.0 - By Scott Szretter
*
* (C)1991 Scott Szretter - Please see the file "COPYRITE.SPS"
*
* ))) Version Changes (((
* --Version-------------Notes-----------------------------------------------------------------
* NONE YET......
*
* This program may not be sold for profit!
* The source code is being release for educational purposes only.
* I take no responsibility for any damage resulting from this code.
*/
#define INMAIN
#include <SetUpA4.h>
#include "MUBBS Module.h"
pascal void main (mode1,G1,P1)
int mode1;
struct GS *G1;
Ptr *P1;{
Handle temph;
float version = 0.5; /* version of MUBBS */
RememberA0(); SetUpA4();
asm { _RecoverHandle }; asm {move.l a0,temph}; HLock(temph); /* lock our module. */
G=G1;
mode[u]=mode1;
switch (mode[u]) {
case 2:
BBSList();
G->moduleresult=0;
break;
case 98:
versionck(version);
break;
case 0:
strcpy (G->programmer,"Scott Szretter");
G->moduleresult=0;
break;
default:
G->moduleresult=1;
break;};
HUnlock(temph); /* unlock module.*/
RestoreA4();}
/**** * * * -BBSList- * * * * ****/
BBSList() {
FILE *stream;
char filename[65];
char temp1[23];
char temp2[19];
char temp3[15];
char temp4[14];
char temp5[80];
char datetime[25];
int SMenu,W,itemp;
if (!G->online[u]) return; /* Log out if hang up */
SMenu=TRUE;
W=TRUE;
strcpy(filename,":bbslist:");
strcat(filename,G->modulename[u]);
strcat(filename,".intro");
print("C> Line %d %s, at: %s\n",(u+1),G->username[u],G->modulename[u]);
loguser(G->modulename[u]); /* write to log file */
send (G->CR[u]);
sendtext(filename);
while (W=TRUE) {
if (!G->online[u]) return;
if (SMenu=TRUE){
send("]] *** BBSList Menu *** ");
send (G->CR[u]);
if (!(cmd1(">> Display, Add, Help, Quit, Logoff "))) G->online[u]=FALSE;
SMenu=FALSE; }
send(G->CR[u]);
if (G->input[u] =='Q') {
W=FALSE;
print("C> Exiting BBSList -> ",G->username[u]);
send("] Thank You for using BBSList!");
return;}
if (G->input[u] =='L') {
W=FALSE;
G->online[u]=FALSE;}
if (G->input[u] =='H') {
strcpy(filename,":bbslist:");
strcat(filename,G->modulename[u]);
strcat(filename,".help");
send (G->CR[u]);
sendtext(filename);
send ("]BBSList 1.0 By - Scott Szretter");
SMenu=TRUE;
W=TRUE;}
if (G->input[u] =='D'){
strcpy(filename,":bbslist:");
strcat(filename,G->modulename[u]);
strcat(filename,".info");
send (G->CR[u]);
sendtext(filename);}
if (G->input[u] =='A'){
send("]Please enter the name of the BBS (20 characters max)");
send("] !--------!---------!");
send("]>");
portsin(temp1, 20);
if (temp1[0] == 0){
send("]Aborted...");
send(G->CR[u]);
return;}
send("]Please enter the phone number of the BBS (16 characters max)");
send("] !--------!-----!");
send("]>");
portsin(temp2, 16);
send("]Please enter the maximum baud of the BBS (12 characters max)");
send("] !--------!-!");
send("]>");
portsin(temp3, 12);
send("]Please enter the software type of the BBS (11 characters max)");
send("]i.e. - MUBBS, WWIV, HRMS, FIDO, RRH, etc...");
send("] !--------!!");
send("]>");
portsin(temp4, 11);
send("]Now, enter a one line (77 char) description of this bbs.");
send("] !--------!---------!---------!---------!---------!---------!---------!------!");
send("]>");
portsin(temp5, 77);
send(G->CR[u]);
strcpy(filename,":bbslist:");
strcat(filename,G->modulename[u]);
strcat(filename,".info");
if ((stream = fopen(filename, "a")) == NULL) { /* Open the file */
send("]FILE ERROR cannot open %s ]", filename);
print("\nFile ERROR Cannot Open %s W",filename);
return;}
gettime("%m/%d/%y",datetime); /* gets the date in m/d/y */
if (fprintf(stream,"%-21s %-17s %-13s %-12s %-15s\r %-77s\r",temp1,temp2,temp3,temp4,datetime,temp5)==EOF) print("bad fprintf conversion\n");
fclose(stream);
send(G->CR[u]);
send("Your entry has been added to the BBSList!");
print("C> Added to WishList -> ",G->username[u]);}
}
}